package com.lxl.example.consumer;

import com.lxl.example.common.model.User;
import com.lxl.example.common.service.UserService;
import com.lxl.lxlrpc.proxy.ServiceProxyFactory;

public class EasyConsumerExample {
    public static void main(String[] args) {
        //最重要的就是创建实例newInstance方法，创建出userService的代理对象
        UserService userService = ServiceProxyFactory.getProxy(UserService.class);
        User user = new User();
        user.setName("lxl");
        User newUser = userService.getUser(user);
        if (newUser != null){
            System.out.println(user.getName());
        }else {
            System.out.println("user == null");
        }
    }
}
